package com.regex.web.controller.szclnf;


import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.regex.web.common.excel.ExportExcel;
import com.regex.web.common.excel.ImportExcel;
import com.regex.web.entity.szclnf.SzclAcceptZsjv4103527DTO;
import com.regex.web.entity.szclnf.SzclNfshrsDTO;
import com.regex.web.entity.szclnf.SzclZzcjrDTO;
import com.regex.web.entity.szclnf.VZzcjrDTO;
import com.regex.web.service.szclnf.ISzclNfshrsService;
import com.regex.web.service.szclnf.ISzclZzcjrService;
import com.regex.web.service.szclnf.IVZzcjrService;
import com.regex.web.utils.AjaxUtil;
import com.regex.web.utils.Contant;
import com.regex.web.utils.QueryResult;
import com.regex.web.vo.ImportResultVO;
import com.regex.web.vo.LayTableDataVO;
import com.regex.web.vo.ResultVO;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zzl
 * @since 2021-07-14
 */
@Controller
@RequestMapping("sys/szclZzcjr")
public class SzclZzcjrController {

	private final static Logger logger = LoggerFactory.getLogger(SzclZzcjrController.class);
	
	@Autowired
	private ISzclZzcjrService ISzclZzcjrService;
	
	@Autowired
	private ISzclNfshrsService ISzclNfshrsService;
	

	@Autowired
	private IVZzcjrService IVZzcjrService;
	/**
	 * 分页查询
	 * @param page
	 * @param model
	 * @param szclZzcjrDTO
	 * @return
	 */
	@GetMapping("show")
	public String show() {
		return "sys/szclZzcjr/show";
	}

	
	@RequestMapping("getPageData")
	public void getPageData(HttpServletResponse response,
			SzclZzcjrDTO szclZzcjrDTO, String limit, String page) {
		LayTableDataVO<SzclZzcjrDTO> result = new LayTableDataVO<SzclZzcjrDTO>();
		try {
			
			QueryWrapper<SzclZzcjrDTO> param = new QueryWrapper<SzclZzcjrDTO>();
			 if(StringUtils.isNotEmpty(szclZzcjrDTO.getXm())){
					param.eq("xm", szclZzcjrDTO.getXm());	
				}
			 if(StringUtils.isNotEmpty(szclZzcjrDTO.getHjlx())){
					param.eq("hjlx", szclZzcjrDTO.getHjlx());	
				}
			 if(StringUtils.isNotEmpty(szclZzcjrDTO.getCjdj())){
					param.eq("cjdj", szclZzcjrDTO.getCjdj());	
				}
			 if(StringUtils.isNotEmpty(szclZzcjrDTO.getCjlb())){
					param.eq("cjlb", szclZzcjrDTO.getCjlb());	
				}
			 if(StringUtils.isNotEmpty(szclZzcjrDTO.getTbsj())){
					param.like("tbsj", szclZzcjrDTO.getTbsj());	
				}
			param.orderByDesc("create_time");
			Page<SzclZzcjrDTO> pageParam = new Page<SzclZzcjrDTO>();
			if (StringUtils.isEmpty(limit)) {
				limit = Contant.NONMAL_PAGE_SIZE_TEN + "";
			}
			if (StringUtils.isEmpty(page)) {
				page = Contant.NONMAL_PAGE_START + "";
			}
			pageParam.setSize(Integer.parseInt(limit));
			pageParam.setCurrent(Integer.parseInt(page));
			
	        QueryResult<SzclZzcjrDTO> pageResult = ISzclZzcjrService.page(pageParam, param);
			
			result.setData(pageResult.getDatas());
			result.setCode(0);
			result.setCount(pageResult.getTotalDataCount());
		} catch (Exception e) {
			result.setCode(500);
			AjaxUtil.ajaxJsonSucMessage(response, result);
			e.printStackTrace();
		}
		AjaxUtil.ajaxJsonSucMessage(response, result);
	}
	
	/**
	 * 编辑/新增
	 * @param id
	 * @param model
	 * @return
	 */
	@GetMapping("input")
    public String toSave(@ModelAttribute("id")  String id) {
        return "sys/szclZzcjr/input";
    }
    
    @GetMapping("get/{id}")
	@ResponseBody
    public ResultVO<SzclZzcjrDTO> getData(@PathVariable String id) {
	    SzclZzcjrDTO szclZzcjrDTO = ISzclZzcjrService.getById(id);
        return ResultVO.success(szclZzcjrDTO, ResultVO.SUCCESS, ResultVO.errors.get(ResultVO.SUCCESS));
    }
    
    /**
	 * 保存
	 * @param szclZzcjrDTO
	 * @param response
	 */
    @PostMapping("save")
	@ResponseBody
	public ResultVO<String> save(@Valid  @RequestBody SzclZzcjrDTO szclZzcjrDTO, HttpServletResponse response) {
		ResultVO<String> result = new ResultVO<String>();
		boolean flag = false;
		if(StringUtils.isNotEmpty(szclZzcjrDTO.getId())) {
			szclZzcjrDTO.setUpdateTime(new Date());
			flag = ISzclZzcjrService.updateById(szclZzcjrDTO);
			if(flag) {
            	return ResultVO.success();
            }
		} else {
			szclZzcjrDTO.setIsDel(Contant.is_del_undelete);
			szclZzcjrDTO.setUpdateTime(new Date());
			szclZzcjrDTO.setCreateTime(new Date());
			flag = ISzclZzcjrService.save(szclZzcjrDTO);
			if(flag) {
            	return ResultVO.success();
            }
		}
		return result;
	}
	
	/**
	 * 详情
	 * @param id
	 * @param model
	 * @return
	 */
	@GetMapping("detial")
    public String detial(String id, Model model) {
        try {
	        if(StringUtils.isNotEmpty(id)) {
	        	SzclZzcjrDTO szclZzcjrDTO = ISzclZzcjrService.getById(id);
	            model.addAttribute("szclZzcjrDTO", szclZzcjrDTO);
	        }
        } catch (Exception e) {
			e.printStackTrace();
			logger.error("detial page is Exception!");
		}
        return "sys/szclZzcjr/detial";
    }
	
	/**
	 * 删除
	 * @param id
	 * @param response
	 */
	@RequestMapping("del")
    public void del(String id, HttpServletResponse response) {
        int n = 0;
        try {
	        if(StringUtils.isNotEmpty(id)) {
	        	boolean flag = ISzclZzcjrService.removeById(id);
	        	if(flag) {
	        		n = 1;
	        	}
	        } else {
	        	n = 2;
	        }
        } catch (Exception e) {
			e.printStackTrace();
			logger.error("del page is Exception!");
		}
        AjaxUtil.ajaxJsonSucMessage(response, n);
    }
    
    /**
	 * 导出
	 * @param response
	 * @param szclZzcjrDTO
	 * @return
	 */
    @RequestMapping(value = "export", method=RequestMethod.POST)
    public String exportFile(HttpServletResponse response, @ModelAttribute("szclZzcjrDTO") SzclZzcjrDTO szclZzcjrDTO) {
        try {
            QueryWrapper<SzclZzcjrDTO> param = new QueryWrapper<SzclZzcjrDTO>();
			param.orderByDesc("create_time");
        	String fileName = "数据"+(new Date()).getTime()+".xlsx";
            
            List<SzclZzcjrDTO> datas = ISzclZzcjrService.list(param);
            new ExportExcel("数据", SzclZzcjrDTO.class).setDataList(datas).write(response, fileName).dispose();
            return null; 
        } catch (Exception e) {
        	logger.error("exportFile page is Exception!");
            e.printStackTrace();
        }
        return "redirect:show.htm";
    }
    
    
     /**
     * 
     * 功能描述: <br>
     * 下载导入模板
     *
     * @return
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    @RequestMapping(value = "importTemplate")
    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
        try {
            String fileName = "信息导入模板.xlsx";
            List<SzclZzcjrDTO> list = new ArrayList<>(); 
            list.add(new SzclZzcjrDTO());
            new ExportExcel("信息数据", SzclZzcjrDTO.class, 2).setDataList(list).write(response, fileName).dispose();
            return null;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "redirect:/sys/szclZzcjr/show";
    }

    
    /**
     * 
     * 功能描述: <br>
     * 去导入界面
     *
     * @return
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    @GetMapping("toImport")
    public String toImport() {
        return "sys/szclZzcjr/import_excel";
    }
    
    /**
     * 
     * 功能描述: <br>
     * 导入
     *
     * @param file
     * @return
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    @RequestMapping("importFile")
    @ResponseBody
    public ResultVO<ImportResultVO> importFile(MultipartFile file, @RequestParam(required = false, value="param") String param) {
        JSONObject json = JSON.parseObject(param);
        logger.error(json!=null?json.toJSONString():"");
        int successNum=0;
        int failureNum=0;
        StringBuilder failureMsg=new StringBuilder();
        ImportExcel ei;
        List<SzclZzcjrDTO> list;
        try {
            ei = new ImportExcel(file, 1, 0);
            list=ei.getDataList(SzclZzcjrDTO.class);
        } catch (Exception e1) {
            e1.printStackTrace();
            list = new ArrayList<>(); 
        }
        for(SzclZzcjrDTO data : list) {
               data.setUpdateTime(new Date());
               data.setIsDel(Contant.is_del_undelete);
               data.setCreateTime(new Date());
               try {
                   ISzclZzcjrService.saveOrUpdate(data);
                   successNum++;
               } catch (Exception e) {
                   e.printStackTrace();
                   failureNum++;
                   failureMsg.append("数据：").append(JSON.toJSONString(data)).append("导入失败；");
               }
        }
        return ResultVO.success(ImportResultVO.result(successNum, failureNum, failureMsg.toString()), ResultVO.SUCCESS, ResultVO.errors.get(ResultVO.SUCCESS));
    }
	
	@GetMapping("getndshrs")
	@ResponseBody
	public List<VZzcjrDTO> getndshrs() {
		
		List<VZzcjrDTO> list= IVZzcjrService.list();
		int zt=0,zt21=0,zts=0,ztf=0,sl=0,sl21=0,sls=0,slf=0,tl=0,tl21=0,tls=0,tlf=0,yy=0,yy21=0,yys=0,yyf=0,zl=0,zl21=0,zls=0,zlf=0,js=0,js21=0,jss=0,jsf=0,dc=0,dc21=0,dcs=0,dcf=0,jc=0,jc21=0,jcs=0,jcf=0;
		
		for (VZzcjrDTO szclZzcjrDTO : list) {
			
			if(szclZzcjrDTO.getCanJiLeiBie()!=""&&szclZzcjrDTO.getCanJiLeiBie()!=null){
				if(szclZzcjrDTO.getCanJiLeiBie().equals("肢体")){
					if(szclZzcjrDTO.getCanJiDengJi()!="" && szclZzcjrDTO.getCanJiDengJi()!=null){
						if(szclZzcjrDTO.getCanJiDengJi().equals("一级") || szclZzcjrDTO.getCanJiDengJi().equals("二级") || szclZzcjrDTO.getCanJiDengJi().equals("三级")){// 肢体2：1
							zt21=zt21+2;
							//按照两名计算
							if(szclZzcjrDTO.getHuJiLeiXing()!=""&& szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									zts=zts+2;
								}
							}
						
						}else{
							zt=zt+1;
							if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									ztf=ztf+1;
								}
							}
						}
					}
				}else if(szclZzcjrDTO.getCanJiLeiBie().equals("视力")){
					if(szclZzcjrDTO.getCanJiDengJi()!="" && szclZzcjrDTO.getCanJiDengJi()!=null){
						if(szclZzcjrDTO.getCanJiDengJi().equals("一级") || szclZzcjrDTO.getCanJiDengJi().equals("二级") || szclZzcjrDTO.getCanJiDengJi().equals("三级")){// 肢体2：1
							sl21=sl21+2;
							//按照两名计算
							if(szclZzcjrDTO.getHuJiLeiXing()!=""&& szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									sls=sls+2;
								}
							}
						
						}else{
							sl=sl+1;
							if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									slf=slf+1;
								}
							}
						}
					}
				}else if(szclZzcjrDTO.getCanJiLeiBie().equals("听力")){
					if(szclZzcjrDTO.getCanJiDengJi()!="" && szclZzcjrDTO.getCanJiDengJi()!=null){
						if(szclZzcjrDTO.getCanJiDengJi().equals("一级") || szclZzcjrDTO.getCanJiDengJi().equals("二级") || szclZzcjrDTO.getCanJiDengJi().equals("三级")){// 肢体2：1
							tl21=tl21+2;
							//按照两名计算
							if(szclZzcjrDTO.getHuJiLeiXing()!=""&& szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									tls=tls+2;
								}
							}
						
						}else{
							tl=tl+1;
							if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									tlf=tlf+1;
								}
							}
						}
					}
				}
				else if(szclZzcjrDTO.getCanJiLeiBie().equals("言语")){
					if(szclZzcjrDTO.getCanJiDengJi()!="" && szclZzcjrDTO.getCanJiDengJi()!=null){
						if(szclZzcjrDTO.getCanJiDengJi().equals("一级") || szclZzcjrDTO.getCanJiDengJi().equals("二级") || szclZzcjrDTO.getCanJiDengJi().equals("三级")){// 肢体2：1
							yy21=yy21+2;
							//按照两名计算
							if(szclZzcjrDTO.getHuJiLeiXing()!=""&& szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									yys=yys+2;
								}
							}
						
						}else{
							yy=yy+1;
							if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									yyf=yyf+1;
								}
							}
						}
					}
				}else if(szclZzcjrDTO.getCanJiLeiBie().equals("智力")){
					if(szclZzcjrDTO.getCanJiDengJi()!="" && szclZzcjrDTO.getCanJiDengJi()!=null){
						if(szclZzcjrDTO.getCanJiDengJi().equals("一级") || szclZzcjrDTO.getCanJiDengJi().equals("二级") || szclZzcjrDTO.getCanJiDengJi().equals("三级")){// 肢体2：1
							zl21=zl21+2;
							//按照两名计算
							if(szclZzcjrDTO.getHuJiLeiXing()!=""&& szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									zls=zls+2;
								}
							}
						
						}else{
							zl=zl+1;
							if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									zlf=zlf+1;
								}
							}
						}
					}
				}else if(szclZzcjrDTO.getCanJiLeiBie().equals("精神")){
					if(szclZzcjrDTO.getCanJiDengJi()!="" && szclZzcjrDTO.getCanJiDengJi()!=null){
						if(szclZzcjrDTO.getCanJiDengJi().equals("一级") || szclZzcjrDTO.getCanJiDengJi().equals("二级") || szclZzcjrDTO.getCanJiDengJi().equals("三级")){// 肢体2：1
							js21=js21+2;
							//按照两名计算
							if(szclZzcjrDTO.getHuJiLeiXing()!=""&& szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									jss=jss+2;
								}
							}
						
						}else{
							js=js+1;
							if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									jsf=jsf+1;
								}
							}
						}
					}
				}
				else if(szclZzcjrDTO.getCanJiLeiBie().equals("多重")){
					if(szclZzcjrDTO.getCanJiDengJi()!="" && szclZzcjrDTO.getCanJiDengJi()!=null){
						if(szclZzcjrDTO.getCanJiDengJi().equals("一级") || szclZzcjrDTO.getCanJiDengJi().equals("二级") || szclZzcjrDTO.getCanJiDengJi().equals("三级")){// 肢体2：1
							dc21=dc21+2;
							//按照两名计算
							if(szclZzcjrDTO.getHuJiLeiXing()!=""&& szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									dcs=dcs+2;
								}
							}
						
						}else{
							dc=dc+1;
							if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
								if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
									dcf=dcf+1;
								}
							}
						}
					}
				}
				if(szclZzcjrDTO.getShiFuJunCan()!="" && szclZzcjrDTO.getShiFuJunCan()!=null){
					if(szclZzcjrDTO.getShiFuJunCan().equals("1")){
						jc=jc+2;
						if(szclZzcjrDTO.getHuJiLeiXing()!="" && szclZzcjrDTO.getHuJiLeiXing()!=null){
							if(szclZzcjrDTO.getHuJiLeiXing().equals("深户")){
								jcf=jcf+1;
							}
						}
					}
				}
			}
			
		}
		SzclNfshrsDTO szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("肢体1:2");
		szclNfshrsDTO.setHjs(zt21+"");
		szclNfshrsDTO.setSh(zts+"");
		szclNfshrsDTO.setFsh((zt21-zts)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("肢体");
		szclNfshrsDTO.setHjs(zt+"");
		szclNfshrsDTO.setSh(ztf+"");
		szclNfshrsDTO.setFsh((zt-ztf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("视力1:2");
		szclNfshrsDTO.setHjs(sl21+"");
		szclNfshrsDTO.setSh(sls+"");
		szclNfshrsDTO.setFsh((tl21-sls)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("视力");
		szclNfshrsDTO.setHjs(sl+"");
		szclNfshrsDTO.setSh(slf+"");
		szclNfshrsDTO.setFsh((sl-slf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("听力1:2");
		szclNfshrsDTO.setHjs(tl21+"");
		szclNfshrsDTO.setSh(tls+"");
		szclNfshrsDTO.setFsh((tl21-tls)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("听力");
		szclNfshrsDTO.setHjs(tl+"");
		szclNfshrsDTO.setSh(tlf+"");
		szclNfshrsDTO.setFsh((tl-tlf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("言语1:2");
		szclNfshrsDTO.setHjs(yy21+"");
		szclNfshrsDTO.setSh(yys+"");
		szclNfshrsDTO.setFsh((yy21-yys)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("言语");
		szclNfshrsDTO.setHjs(yy+"");
		szclNfshrsDTO.setSh(yyf+"");
		szclNfshrsDTO.setFsh((yy-yyf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("智力1:2");
		szclNfshrsDTO.setHjs(zl21+"");
		szclNfshrsDTO.setSh(zls+"");
		szclNfshrsDTO.setFsh((zl21-zls)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("智力");
		szclNfshrsDTO.setHjs(zl+"");
		szclNfshrsDTO.setSh(zlf+"");
		szclNfshrsDTO.setFsh((zl-zlf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("精神1:2");
		szclNfshrsDTO.setHjs(js21+"");
		szclNfshrsDTO.setSh(jss+"");
		szclNfshrsDTO.setFsh((js21-jss)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("精神");
		szclNfshrsDTO.setHjs(js+"");
		szclNfshrsDTO.setSh(jsf+"");
		szclNfshrsDTO.setFsh((js-jsf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("多重1:2");
		szclNfshrsDTO.setHjs(dc21+"");
		szclNfshrsDTO.setSh(dcs+"");
		szclNfshrsDTO.setFsh((dc21-dcs)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("多重");
		szclNfshrsDTO.setHjs(dc+"");
		szclNfshrsDTO.setSh(dcf+"");
		szclNfshrsDTO.setFsh((dc-dcf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		
		szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("军残1:2");
		szclNfshrsDTO.setHjs(jc+"");
		szclNfshrsDTO.setSh(jcf+"");
		szclNfshrsDTO.setFsh((jc-jcf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);
		/*szclNfshrsDTO=new SzclNfshrsDTO();
		szclNfshrsDTO.setNr("军残");
		szclNfshrsDTO.setHjs(dc+"");//军残等级没有，目前都按照双数计算
		szclNfshrsDTO.setSh(dcf+"");
		szclNfshrsDTO.setFsh((dc-dcf)+"");
		ISzclNfshrsService.save(szclNfshrsDTO);*/
		return list;
	
		
	}
}
